package cn.zmf.springbootyuan.controller;

import cn.zmf.springbootyuan.mapper.EmployeeMapper;
import cn.zmf.springbootyuan.pojo.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Collection;

@Controller
public class EmployeeController {
    @Autowired
    EmployeeMapper employeeMapper;

    @RequestMapping("/emps")
    public String list(Model model) {
        Collection<Employee> employees = employeeMapper.getAll();
        model.addAttribute("emps", employees);
        return "emp/list";
    }

}
